package com.eastfair.pay.dao;

import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author Du Xiaobo
 * @date 2023/6/21 15:36
 */
@Repository
public interface StatisticsMapper {
    @MapKey("order_status")
    List<Map<String, Object>> orderStatusStatistics(@Param("startTime") String startTime, @Param("endTime") String endTime,@Param("orderType") String orderType);

    @MapKey("days")
    List<Map<String, Object>> orderTypeStatistics(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("orderType") String orderType);

    Double revenue(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("payee") String payee);

    Integer revenueCount(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("payee") String payee);

    Double expenditure(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("payee") String payee);

    Integer expenditureCount(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("payee") String payee);

    @MapKey("days")
    List<Map<String, Object>> revenueLine(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("payee") String payee);

    @MapKey("days")
    List<Map<String, Object>> expenditureLine(@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("payee") String payee);

    Double balance(@Param("date") String date, @Param("payee") String payee);
}
